import java.io.*;

class ExerciseTwo {
    static class CmdReadException extends Exception {
    }

    static class VisitException extends Exception {
    }

    static public void main(String args[]) {
        ExerciseTwo test = new ExerciseTwo();
        try {
            test.visitPath(getInputPath());
        } catch (CmdReadException e) {
            System.out.println("Standard Input Error!");
        } catch (VisitException e) {
            System.out.println("File or directory does not exist!");
        }
    }

    static private String getInputPath() throws CmdReadException {
        try {
            BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
            System.out.println("Enter an path:");
            return stdin.readLine();
        } catch (IOException e) {
            throw new CmdReadException();
        }
    }

    public void visitPath(String path) throws VisitException {
        File file = new File(path);
        if (!file.exists()) {
            throw new VisitException();
        }

        if (file.isFile()) {
            System.out.println("Path: " + path + " is a file.");
        } else {
            System.out.println("Path: " + path + " is a directory.");
        }
    }
}
